﻿using System.Collections.Generic;
//
namespace PerceptiveMCAPI.Types
{
	public class Api_BaseOutput
	{
		#region -----------------------------------------------------------  properties

		// duplicate from base input, but don't inherit 
		public string api_Method { get; private set; }
		public string api_URL { get; private set; }
		public string api_DataCenter { get; private set; }
		public string api_Version { get; private set; }
		public EnumValues.AccessType api_AccessType { get; private set; }
		public EnumValues.OutputType api_OutputType { get; private set; }
		public EnumValues.MethodType api_MethodType { get; private set; }
		public bool api_EncodeRequest { get; private set; }
		public bool api_Validate { get; private set; }
		public bool api_CustomErrorMessages { get; private set; }
		public bool api_SecureAccess { get; private set; }
		public int api_Timeout { get; private set; }

		// additional
		public string api_Request { get; set; }
		public string api_Response { get; set; }
		public int api_RequestLength { get; set; }
		public int api_ResponseLength { get; set; }
		public List<Api_ValidatorMessage> api_ValidatorMessages { get; set; }
		public List<Api_Error> api_ErrorMessages { get; set; }

		// let user data be modified in output -- might be handy
		public object api_UserData { get; set; }

		#endregion

		#region ------------------------------------------------------------ constructor

		public Api_BaseOutput()
		{
			api_ValidatorMessages = new List<Api_ValidatorMessage>();
			api_ErrorMessages = new List<Api_Error>();
		}

		public Api_BaseOutput( Api_BaseInput input )
		{
			this.api_Method = input.api_Method;
			this.api_URL = input.api_URL;
			this.api_DataCenter = input.api_DataCenter;
			this.api_Version = input.api_Version;
			this.api_AccessType = input.api_AccessType;
			this.api_OutputType = input.api_OutputType;
			this.api_MethodType = input.api_MethodType;
			this.api_EncodeRequest = input.api_EncodeRequest;
			this.api_Validate = input.api_Validate;
			this.api_CustomErrorMessages = input.api_CustomErrorMessages;
			this.api_SecureAccess = input.api_SecureAccess;
			this.api_Timeout = input.api_Timeout;
			//
			this.api_UserData = input.api_UserData;

			api_ValidatorMessages = new List<Api_ValidatorMessage>();
			api_ErrorMessages = new List<Api_Error>();
		}

		#endregion

	}
}
